05. API Key Setup Instructions
API Key Setup Instructions
- Go to the Google API Console.
- Create or select a project.
- Click Continue to enable the Google Places API for Android.
- On the Credentials page, get an API key.
Note: If you have an existing API key with Android restrictions, you may use that key.
Restricting your API key
To control who can use this key to access Google's API; restrict the key to a certain Android app
- From the dialog displaying the API key, select Restrict key to set an Android restriction on the API key.
- In the Restrictions section, select Android apps, then enter your app's SHA-1 fingerprint and package name. For example:
BB:0D:AC:74:D3:21:E1:43:67:71:9B:62:91:AF:A1:66:6E:44:5D:75
com.example.android.places-example - Click Save.
To find your app's SHA-1 fingerprint information and for more information refer to this Google documentation.
Your new Android-restricted API key appears in the list of API keys for your project. An API key is a string of characters, something like this:
AIzaSyBdVl-cTICSwYKrZ95SuvNw7dbMuDt1KG0
It may take up to 5 minutes for the key to be fully provisioned. If the key does not work immediately, try again in 5 minutes.